package mh;


/**
 * 
 * @author Gianmarco Laggia
 * 
 */
public class PlayerEntity extends Entity {

	private static int		darkness;
	private static long		experience;
	private static int		level;
	private static long		lifePoints;
	private static double	magicPower;
	private static long		money;
	private int				fireInterval;

	/**
	 * Constructor of the player entity, all x and y are the same
	 * 
	 * @param sprite
	 *            The path of the sprite set
	 * @param x
	 *            The X position of the Player (tile unit)
	 * @param y
	 *            The Y position of the Player (tile unit)
	 */
	public PlayerEntity(String sprite, int x, int y) {
		super(sprite, x, y, x, y);
		this.animationFrameDuration = VELOCITY / 3;
	}

	@Override
	public void draw(long delta) {
		if (!this.moving) {
			this.sprite.setFrame(1);
		} else {
			this.lastFrameChange += delta;
			if (this.lastFrameChange > this.animationFrameDuration) {
				this.lastFrameChange = 0;
				this.sprite.frameUp();
			}
		}
		this.sprite.draw(this.playerX * 32, this.playerY * 32);
	}

	@Override
	public void move(long delta, int direction) {
		this.moving = true;
		this.sprite.setDirection(direction);
	}

	//	public void collidedWith(EntityOld other) {
	//		if (other instanceof SpellEntity) {
	//			// tells the server I have been hit
	//			// oh, I have been hit
	//		}
	//
	//	}
	//
	//	public int getFI() {
	//		return this.fireInterval;
	//	}
	//	
	//	public void hitDamage(int value) {
	//		lifePoints -= value;
	//	}
	//
	//	public void setFI(int i) {
	//		this.fireInterval = i;
	//	}
}
